<?php
/**
 * In Array Keys Rule
 * Determine if a value is in an array's keys
 *
 * @todo        The InArray rule can check type and case-sensativity, maybe this should too
 * @package     Q-Validate
 * @subpackage  Rules
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2010 Luke Visinoni <luke.visinoni@gmail.com>
 * @version     $Id: InArrayKeys.php 37 2010-12-23 02:38:44Z luke.visinoni $
 */
class Q_Rule_InArrayKeys extends Q_Rule_Abstract {

    /**
     * The parameters that were passed to this rule
     */
    protected $_params = array(
        'array' => array(),
    );
    
    /**
     * @todo Add a "case_insensitive" param
     */
    public function isValid($value) {
    
        return array_key_exists($value, $this->getParam('array'));
    
    }

}
